package com.bds;

import com.bds.btcdc.snatch.PairSnatchTask;
import com.bds.btcdc.utils.SpringContextHolder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;


@SpringBootApplication
public class App {
	public static void main(String[] args) {
		SpringApplication springApplication = new SpringApplication(App.class);
		ApplicationContext context = springApplication.run(args);
		SpringContextHolder.setApplicationContext(context);
		ScheduledExecutorService scheduled = Executors.newSingleThreadScheduledExecutor();
 		//汇率定时查询
		scheduled.scheduleAtFixedRate(new PairSnatchTask(), 5, 60*60*1, TimeUnit.SECONDS);
	}
}
